# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-test-requiresinternet
_pkgreal=Test-RequiresInternet
pkgver=0.05
pkgrel=4
pkgdesc="Easily test network connectivity"
url="https://metacpan.org/release/Test-RequiresInternet/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/M/MA/MALLEN/$_pkgreal-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	default_prepare
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make
}

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

check() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make test
}

sha512sums="572af3e6fdfb90df3a58ba6eaf571717b294a54fff4b3f597fd177f1eb91fb1c929cb808f8d219f692314a944cf41dc1afab41f5a0dd2185054c08fec69e66c3  Test-RequiresInternet-0.05.tar.gz"
